1. Filed of the Invention
The present invention relates to a data storage device, a memory management method and a program.
2. Description of the Related Art
A memory, in which data exchanged with a reader/writer (which has a function for reading or writing information in a non-contact type IC(Integrated Circuit) card and the like,) through communication, an application program needed to provide services and the like can be stored, is usually included in a communication device capable of non-contact communication, such as a portable telephone, via a non-contact type IC card or a non-contact type IC chip installed therein. Such a memory may be a volatile memory used as a buffer or the like or it may be a nonvolatile memory used to record user data and an application program. In the nonvolatile memory, user information and information on a file system used for accessing to the user information, for instance, may be recorded.
In addition, the nonvolatile memory may be partitioned into a plurality of memory areas, each allocated to one of various systems. The term “system” in this context refers to a logical IC card function which may be provided in, for instance, a single non-contact type IC card having a single function.
The data area may be partitioned by adopting a logical partitioning technology in which the address range of each partitioned memory area is defined based upon logical addresses indicating virtual recording positions or by adopting a physical partitioning technology in which the address range of each partitioned memory area is defined based upon physical addresses indicating the recording positions in the actual memory. It is to be noted that a logical address is mapped in relation to the physical address corresponding to the particular logical address. However, contiguous logical addresses do not necessarily correspond to contiguous physical addresses. For this reason, when the memory is partitioned through logical partitioning technology, contiguous logical addresses indicating a given partitioned memory area may be mapped at discrete physical addresses. In such a case, even when it is known that the data to be extracted are contained in a specific logical address range (memory area), the communication device executes a search over a physical address range in the actual memory, which is greater than the logical address range, resulting in poor search efficiency.
In the physical partitioning technology, each physical address range is allocated to one of the partitioned memory areas, and thus, the communication device searching for data in a specific memory area, executes a search over the physical address range allocated to the particular memory area, assuring a high level of search efficiency. For instance, Japanese Patent Application Publication No. 2000-172490 discloses a data search method adopting such a physical partitioning technology. However, even when the memory is partitioned by adopting the physical partitioning technology, the individual partitions do not always maintain their continuity from one another. Such a situation may manifest in, for instance, the nonvolatile memory included in the communication device described earlier.
A memory management system that effectively prevents data loss is adopted in nonvolatile memory in a communication device or the like as measures against data loss in the event of a power supply interruption occurring during a data write or a communication interruption occurring before data transfer completion. For instance, when data are updated in the communication device, the new data may be first buffered in an available area and the old data may be erased only when the buffering process is completed, instead of directly writing the new data over the existing data.